#pragma once

#include <QtCore/QTimer>
#include <QtGui/QFrame>
#include <QtGui/QListWidget>
#include <QtGui/QPushButton>
#include "MefoolDeviceManager.h"

namespace Mefool
{

class MefoolQDeviceManagerWidget : public QFrame,
								   public Mefool::DeviceManager::Listener
{ 
	Q_OBJECT

public:
	MefoolQDeviceManagerWidget( QWidget* parent, Mefool::DeviceManager* deviceManager );
	virtual ~MefoolQDeviceManagerWidget();

protected:
	virtual void onDeviceAdded( DeviceManager* deviceManager, Device* device );
	virtual void onDeviceRemoved( DeviceManager* deviceManager, Device* device );

	void						updateDeviceListWidget();

private slots:
	void						onTimerTimeOut();
	//void						startStopButtonPressed();

private:
	Mefool::DeviceManager*		mDeviceManager;
	QTimer*						mTimer;
	QListWidget*				mDeviceListWidget;
	QPushButton*				mStartStopButton;
};

}
